#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright (2) 2017 Igor Kozhukhov <igor@dilos.org>
#

PROG= zdump

OBJS= zdump.o ialloc.o scheck.o

CMDDIR=	$(SRC)/common/tzcode/zic
SRCS= $(OBJS:%.o=$(CMDDIR)/%.c)

include $(SRC)/cmd/Makefile.cmd
include $(SRC)/cmd/Makefile.cmd.64
include $(SRC)/cmd/Makefile.ctf

CPPFLAGS += -I$(SRC)/common/tzcode/stdtime
#LDLIBS += 
CFLAGS +=	$(CCVERBOSE)
CFLAGS += -DTM_GMTOFF=tm_gmtoff -DTM_ZONE=tm_zone -DSTD_INSPIRED -DPCTS
CFLAGS += -DHAVE_LONG_DOUBLE -DTZDIR=\"/usr/share/zoneinfo\"
CFLAGS += -DHAVE_STRERROR -DHAVE_UNISTD_H
C99MODE = $(C99_ENABLE)

CERRWARN +=	-_gcc4=-Wno-strict-overflow

.KEEP_STATE:

all: $(PROG) 

install: all .WAIT $(ROOTPROG)

$(PROG): $(OBJS)
	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
	$(POST_PROCESS)

%.o:	$(CMDDIR)/%.c
	$(COMPILE.c) -o $@ $<
	$(POST_PROCESS_O)

clean:
	$(RM) $(OBJS)

lint:	lint_SRCS

include $(SRC)/cmd/Makefile.targ
